package cn.edu.hitwh.kanlema.controller;


import cn.edu.hitwh.kanlema.dto.Result;
import cn.edu.hitwh.kanlema.service.IVoucherOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author vvcoder
 * @since 2025-8-18
 */
@RestController
@RequestMapping("/voucher-order")
public class VoucherOrderController {
    @Autowired
    private IVoucherOrderService voucherOrderService;

    @PostMapping("seckill/{id}")
    @ApiOperation("秒杀优惠券")
    public Result seckillVoucher(@PathVariable("id") Long voucherId) {
        Long voucherOrderId = voucherOrderService.seckillVoucher(voucherId);
        return Result.ok(voucherOrderId);
    }
}
